<!DOCTYPE html>
<html lang="en">
<head>
<title>教师信息管理系统</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <link rel="stylesheet" href="../css/bootstrap.min.css" />
  <link rel="stylesheet" href="../css/bootstrap-responsive.min.css" />
  <link rel="stylesheet" href="../css/colorpicker.css" />
  <link rel="stylesheet" href="../css/datepicker.css" />
  <link rel="stylesheet" href="../css/uniform.css" />
  <link rel="stylesheet" href="../css/select2.css" />
  <link rel="stylesheet" href="../css/matrix-style2.css" />
  <link rel="stylesheet" href="../css/matrix-media.css" />
  <link rel="stylesheet" href="../css/bootstrap-wysihtml5.css" />
  <link href="../font-awesome/css/font-awesome.css" rel="stylesheet" />
  <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,800' rel='stylesheet' type='text/css'>

</head>
<body>

<div id="content">
  <div id="content-header">
      <h1>教学情况</h1>
  </div>
  <div class="container-fluid">

    <div class="row-fluid">
      <div id="form_1" class="span12">
        <button id="adde" class="btn btn-info btn-large" style="border-radius: 5px">添加教学内容</button>
        <form action="/teacherInfo/leadOut" method="post" style="display: inline-block;">
          <input id="cuId2" name="cuId" type="text" style="display: none" >
          <input type="submit" class="btn btn-info btn-large" style="border-radius: 5px"; value="保存为Excel";>
        </form>
        <div class="widget-box">
          <div class="widget-title"> <span class="icon"> <i class="icon-align-justify"></i> </span>
            <h5>教学内容</h5>
          </div>
          <div class="widget-content nopadding">
            <span id="span1" style="color: red;" className="teacherInfo"></span>
            <table class="table table-bordered table-striped" frame="box">
              <thead>
              <tr><th colspan="11" >已添教学内容（删除重新添加以修改）</th></tr>
              <tr>
                <th>编号</th>
                <th>学期时间</th>
                <th>课程编号</th>
                <th>课程名</th>
                <th>课程性质</th>
                <th>理论课时</th>
                <th>实验学时</th>
                <th>实训学时</th>
                <th>是否优质课</th>
                <th>本人承担实际学时</th>
                <th>操作</th>
              </tr>
              </thead>
              <tbody id="tbody">
              </tbody>
            </table>
            <div id="form3" class="span12" style="display: none">
              <form id="form1" action="#" method="get" class="form-horizontal">
                <input id="cuId" name="cuId" type="text" style="display: none">
                <div class="control-group">
                  <label class="control-label">学期时间：</label>
                  <div class="controls">
                    <select name="termTime">
                      <option value="2015-2016第二学期">2015-2016第二学期</option>
                      <option value="2016-2017第一学期">2016-2017第一学期</option>
                      <option value="2016-2017第二学期">2016-2017第二学期</option>
                      <option value="2017-2018第一学期">2017-2018第一学期</option>
                      <option value="2017-2018第二学期">2017-2018第二学期</option>
                      <option value="2018-2019第一学期">2018-2019第一学期</option>
                      <option value="2018-2019第二学期">2018-2019第二学期</option>
                      <option value="2019-2020第一学期">2019-2020第一学期</option>
                    </select>
                  </div>
                </div>
                <div class="control-group">
                  <label class="control-label">课程编号：</label>
                  <div class="controls">
                    <select name="courseNum">
                      <option value="1">1</option>
                      <option value="2">2</option>
                    </select>
                  </div>
                </div>
                <div class="control-group">
                  <label class="control-label">课程名 ：</label>
                  <div class="controls">
                    <input name="courseName" type="text" class="span11"  />
                  </div>
                </div>
                <div class="control-group">
                  <label class="control-label">课程性质：</label>
                  <div class="controls">
                    <input name="courseNature" type="text" class="span11"  />
                  </div>
                </div>
                <div class="control-group">
                  <label class="control-label">理论课时：</label>
                  <div class="controls">
                    <input name="theory" type="text" class="span11"  />
                  </div>
                </div>
                <div class="control-group">
                  <label class="control-label">实验学时 ：</label>
                  <div class="controls">
                    <input name="experimental" type="text" class="span11" />
                  </div>
                </div>
                <div class="control-group">
                  <label class="control-label">实训学时 ：</label>
                  <div class="controls">
                    <input name="training" type="text" class="span11" />
                  </div>
                </div>
                <div class="control-group">
                  <label class="control-label">是否优质课：</label>
                  <div class="controls">
                    <input type="radio" name="qualityClass" class="span11" value="是" > 是
                    <input type="radio" name="qualityClass" class="span11" value="否" checked> 否
                  </div>
                </div>
                <div class="control-group">
                  <label class="control-label">本人承担实际学时 ：</label>
                  <div class="controls">
                    <input name="persion" type="text" class="span11" />
                  </div>
                </div>
              </form>
              <center>
                <div class="control-group">
                  <div class="controls">
                    Excel：<input id="excel"  type="file" size="15" style="opacity: 0;"><br>
                    <button id="leadIn" class="btn btn-primary btn-large" style="margin-bottom: 20px;border-radius: 5px">导入Excel</button>
                    <button id="btn1" class="btn btn-success btn-large" style="margin-bottom: 20px;border-radius: 5px">保存基本信息</button>
                  </div>
                </div>

              </center>
            </div>
          </div>
        </div>
      </div>
    </div>

  </div>
</div>

<script src="http://www.jq22.com/jquery/jquery-1.7.1.js"></script>
<script src="../js/jquery.ui.custom.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/bootstrap-colorpicker.js"></script>
<script src="../js/bootstrap-datepicker.js"></script>

<script src="../js/masked.js"></script>
<script src="../js/jquery.uniform.js"></script>
<script src="../js/select2.min.js"></script>
<script src="../js/matrix.js"></script>
<script src="../js/matrix.form_common.js"></script>
<script src="../js/wysihtml5-0.3.0.js"></script>
<script src="../js/jquery.peity.min.js"></script>
<script src="../js/bootstrap-wysihtml5.js"></script>
<script type="text/javascript" src="../js/jquery.cookie.js"></script>
<script src="../js/tool.js"></script>
<script>
  $(function () {
    var CLASS_NAME=$("#span1").attr("className");
    queryPage(1);

    //保存
    $("#btn1").click(function () {
      var certificate=$("#certificate").val();
      var r = confirm("* 需提供教案课件\n"+
              "\t\t您是否确定保存？")
      if (r == true) {
        add(CLASS_NAME);
      }
    })
  })
  //表格填充
  function queryPage(pageNum){
    //当前页码
    pageNum= pageNum==undefined?1:pageNum;

    //页码的有效性判断
    $.get("../teacherInfo",{page:pageNum,limit:50,cuId:$.cookie("cuId")},function(result){
      console.log(result.data)
      //填充数据到tbody
      $("#tbody").empty();//清除之前的内容
      $(result.data).each(function(index,teacherInfo){
        console.log(teacherInfo.certificate)
        $("#tbody").append(
                " <tr>"+
                "<td>"+(index+1)+"</td>"+
                "<td>"+teacherInfo.termTime+"</td>"+
                "<td >"+teacherInfo.courseNum+"</td>"+
                "<td >"+teacherInfo.courseName+"</td>"+
                "<td>"+teacherInfo.courseNature+"</td>"+
                "<td>"+teacherInfo.theory+"</td>"+
                "<td>"+teacherInfo.experimental+"</td>"+
                "<td>"+teacherInfo.training+"</td>"+
                "<td>"+teacherInfo.qualityClass+"</td>"+
                "<td>"+teacherInfo.persion+"</td>"+
                "<td>"+
                "<a href='#' id='remove' class='icon-trash' eid="+teacherInfo.id+" >删除</a></td>"+
                "</tr>"
        );
      })

    },"json");
  }
</script>
</body>
</html>
